package com.catering.service.impl;

import com.catering.mapper.DishMapper;
import com.catering.pojo.Dish;
import com.catering.pojo.Employee;
import com.catering.pojo.VO.Pages;
import com.catering.service.DishService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DishServiceImpl implements DishService {
    @Resource
    private DishMapper dishMapper;


    @Override
    public PageInfo<Dish> showPage(Pages pages) {
        PageHelper.startPage(pages.getStart(),pages.getCount());
        List<Dish>list= dishMapper.showPage(pages);
        PageInfo<Dish> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
